﻿using System;

namespace QFramework.Example
{
    public class MyItemKitResLoadHandler : IItemKitResLoadHandler
    {
        private ResLoader mResLoader = ResLoader.Allocate();
        public ItemDatabase LoadItemDatabase(string databaseName)
        {
            return mResLoader.LoadSync<ItemDatabase>($"resources://{databaseName}");
        }

        public void LoadItemDatabaseAsync(string databaseName, Action<ItemDatabase> onLoadFinish)
        {

        }

        public ItemLanguagePackage LoadLanguagePackage(string languagePackageName)
        {
            return mResLoader.LoadSync<ItemLanguagePackage>($"resources://{languagePackageName}");
        }

        public void LoadLanguagePackageAsync(string languagePackageName, Action<ItemLanguagePackage> onLoadFinish)
        {

        }
    }
}
